package com.zzzyh.springproject.mapper;

import com.zzzyh.springproject.pojo.Category;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;

@Mapper
public interface CategoryMapper {
    @Select("SELECT * FROM `vueshop_category`")
    List<Category> getList();

    @Select("SELECT * FROM `vueshop_category` where id = #{id}")
    Category getCategory(Integer id);

    void addCategory(Category category);

    void updateCategory(Category category);

    @Delete("delete from `vueshop_category` WHERE id = #{id}")
    void deleteCategory(Integer id);
}
